/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Messenj;

import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Graphics;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author edoardo
 */
public class Notificator extends JFrame{

    String text;

    public Notificator(String text) {
        super();
        this.text = text;
        //editorFrame.getRootPane().putClientProperty("Window.alpha", new Float(0.8f));
        this.getRootPane().putClientProperty("Window.alpha", new Float(0.5f));
    }

    public Notificator() {
        this("Errore");
    }

    @Override
    public void paint(Graphics g) {
        FontMetrics fm = g.getFontMetrics();
        int heigth = fm.getHeight();
        g.drawString(text, 10, this.getHeight() / 2 - (heigth / 2));
    }

}
